<template>
  <section class="yl-clearfix">
    <div class="searchgrid">

      <div class="yl-float-right">
        <input class="yl-input-text" v-model="filters.employe_id" type="text" placeholder="代理商编号">
        <input class="yl-input-text" v-model="filters.cellphone" type="text" placeholder="客户手机号">
        <input value=" 查询 " class="yl-input-button" type="button" @click="fetchEmployeeDayReportList">
        <input value=" 导出xls " class="yl-input-button" type="button" @click="">

      </div>
    </div>
    <el-table :data="pagination.data"
              highlight-current-row
              v-loading="listLoading"
              style="width: 100%;">
      <el-table-column label="员工ID" prop="emp_id"></el-table-column>
      <el-table-column label="手机号" prop="emp_name"></el-table-column>
      <el-table-column label="姓名" prop="emp_phone"></el-table-column>


      <el-table-column label="注册时间" prop="emp_register_date"></el-table-column>
      <el-table-column prop="cust_day_capital_amount" label="可用余额"></el-table-column>

      <el-table-column prop="cust_day_stock_finance" label="新增配资"></el-table-column>

      <el-table-column label="累计配资金额" prop="full.cust_total_stock_finance"></el-table-column>

      <el-table-column label="交易金额" prop="cust_day_makedeal"></el-table-column>


      <el-table-column label="递延费" prop="total_interests_percentage"></el-table-column>
      <el-table-column prop="total_commision_percentage" label="服务费"></el-table-column>


    </el-table>

    <div class="yl-pagination">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="pageIndexChange"
        :current-page="pagination.current_page"
        :page-sizes="[15, 30, 45, 60]"
        layout="total, sizes, prev, pager, next, jumper"
        :page-size="parseInt(pagination.per_page)"
        :total="pagination.total"
        style="float:right;">
      </el-pagination>
    </div>

  </section>

</template>

<script>
  import {getEmployeeDayReports} from '../../api/report';

  export default {
    data() {
      return {
        filters: {
          cellphone: null,
          page: 1,
          size: 15,
          employe_id: null,
        },
        pagination: {},
        listLoading: false,
      }
    },
    methods: {
      pageIndexChange(clickPageIndex) {
        //分页页面发生改变
        this.filters.page = clickPageIndex;
        this.fetchEmployeeDayReportList();
      },
      //获取用户列表
      fetchEmployeeDayReportList() {
        let params = this.filters;
        this.listLoading = true;
        getEmployeeDayReports({params}).then((res) => {
          this.pagination = res.data;
          this.listLoading = false;
        }).catch(error => this.ezNotifyAxiosCatch(error));
      },
      handleSizeChange(size) {
        this.filters.size = size;
        this.filters.page = 1;
        this.fetchEmployeeDayReportList();
      }
    },
    mounted() {
      this.fetchEmployeeDayReportList();
    }
  }
</script>

